package com.simple.relaxed.manager;

import java.util.HashMap;
import java.util.Map;

public abstract class AbstractManager<T, S> implements Manager<T, S> {

    protected Map<T, S> map;

    public AbstractManager() {
        map = new HashMap<>();
    }

    @Override
    public void register(T t, S s) {
        map.put(t, s);
    }

    @Override
    public void unregister(T t) {
        map.remove(t);
    }

    @Override
    public S lookup(T t) {
        return map.get(t);
    }

    @Override
    public Map<T, S> lookup() {
        return map;
    }

    @Override
    public void clear() {
        map.clear();
    }
}
